Optical encoders can be used to detect motion, for example, of a rotating code scale (e.g., a cylindrical code wheel) that includes a pattern of stripes to reflect light in a known pattern. Motion of the code scale can be detected optically using a light emitter and a light detector. As the code scale rotates, the intensity and direction of light reflected by the code scale varies. In particular, light is reflected by the pattern on the code scale such that a corresponding pattern of light can be detected by the detector. The detected pattern can be converted, for example by a signal processor, into a digital signal that is indicative of the movement, position, direction, or speed of the code scale.